home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / Controls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  23.9 KB  |  656 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Controls.h
  3.  
  4.      Contains:    Control Manager interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.3
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __CONTROLS__
  21. #define __CONTROLS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __QUICKDRAW__
  30. #include <Quickdraw.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <QuickdrawText.h>                                    */
  34.  
  35. #ifndef __MENUS__
  36. #include <Menus.h>
  37. #endif
  38. /*    #include <Memory.h>                                            */
  39.  
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43.  
  44. #if PRAGMA_ALIGN_SUPPORTED
  45. #pragma options align=mac68k
  46. #endif
  47.  
  48. #if PRAGMA_IMPORT_SUPPORTED
  49. #pragma import on
  50. #endif
  51.  
  52. /*_________________________________________________________________________________________________________*/
  53. /**/
  54. /* • CONTROL DEFINITION ID'S*/
  55. /**/
  56. /*_________________________________________________________________________________________________________*/
  57. /**/
  58. /* Standard System 7 procID's for use only with NewControl()*/
  59. /**/
  60.  
  61. enum {
  62.     pushButProc                    = 0,
  63.     checkBoxProc                = 1,
  64.     radioButProc                = 2,
  65.     scrollBarProc                = 16,
  66.     popupMenuProc                = 1008
  67. };
  68.  
  69. enum {
  70.     kControlUsesOwningWindowsFontVariant = 1 << 3                /* Control uses owning windows font to display text*/
  71. };
  72.  
  73. /*_________________________________________________________________________________________________________*/
  74. /**/
  75. /* • CONTROL PART CODES*/
  76. /**/
  77. /*_________________________________________________________________________________________________________*/
  78. typedef SInt16 ControlPartCode;
  79.  
  80.  
  81. enum {
  82.     kControlNoPart                = 0,
  83.     kControlLabelPart            = 1,
  84.     kControlMenuPart            = 2,
  85.     kControlTrianglePart        = 4,
  86.     kControlButtonPart            = 10,
  87.     kControlCheckBoxPart        = 11,
  88.     kControlRadioButtonPart        = 11,
  89.     kControlUpButtonPart        = 20,
  90.     kControlDownButtonPart        = 21,
  91.     kControlPageUpPart            = 22,
  92.     kControlPageDownPart        = 23,
  93.     kControlIndicatorPart        = 129,
  94.     kControlDisabledPart        = 254,
  95.     kControlInactivePart        = 255
  96. };
  97.  
  98. /*_________________________________________________________________________________________________________*/
  99. /**/
  100. /* • CHECK BOX VALUES*/
  101. /**/
  102. /*_________________________________________________________________________________________________________*/
  103. enum {
  104.     kControlCheckboxUncheckedValue = 0,
  105.     kControlCheckboxCheckedValue = 1,
  106.     kControlCheckboxMixedValue    = 2
  107. };
  108.  
  109. /*_________________________________________________________________________________________________________*/
  110. /**/
  111. /* • RADIO BUTTON VALUES*/
  112. /**/
  113. /*_________________________________________________________________________________________________________*/
  114. enum {
  115.     kControlRadioButtonUncheckedValue = 0,
  116.     kControlRadioButtonCheckedValue = 1,
  117.     kControlRadioButtonMixedValue = 2
  118. };
  119.  
  120. /*_________________________________________________________________________________________________________*/
  121. /* */
  122. /* • CONTROL POP-UP MENU CONSTANTS*/
  123. /**/
  124. /*_________________________________________________________________________________________________________*/
  125. /**/
  126. /* Variant codes for the System 7 pop-up menu*/
  127. /**/
  128. enum {
  129.     popupFixedWidth                = 1 << 0,
  130.     popupVariableWidth            = 1 << 1,
  131.     popupUseAddResMenu            = 1 << 2,
  132.     popupUseWFont                = 1 << 3
  133. };
  134.  
  135. /**/
  136. /* Menu label styles for the System 7 pop-up menu */
  137. /**/
  138. enum {
  139.     popupTitleBold                = 1 << 8,
  140.     popupTitleItalic            = 1 << 9,
  141.     popupTitleUnderline            = 1 << 10,
  142.     popupTitleOutline            = 1 << 11,
  143.     popupTitleShadow            = 1 << 12,
  144.     popupTitleCondense            = 1 << 13,
  145.     popupTitleExtend            = 1 << 14,
  146.     popupTitleNoStyle            = 1 << 15
  147. };
  148.  
  149. /**/
  150. /* Menu label justifications for the System 7 pop-up menu*/
  151. /**/
  152. enum {
  153.     popupTitleLeftJust            = 0x00000000,
  154.     popupTitleCenterJust        = 0x00000001,
  155.     popupTitleRightJust            = 0x000000FF
  156. };
  157.  
  158. /*_________________________________________________________________________________________________________*/
  159. /**/
  160. /* • CONTROL DRAGGRAYRGN CONSTANTS*/
  161. /**/
  162. /*   For DragGrayRgnUPP used in TrackControl() */
  163. /**/
  164. /*_________________________________________________________________________________________________________*/
  165. enum {
  166.     noConstraint                = kNoConstraint,
  167.     hAxisOnly                    = 1,
  168.     vAxisOnly                    = 2
  169. };
  170.  
  171. /*_________________________________________________________________________________________________________*/
  172. /**/
  173. /* • CONTROL COLOR TABLE PART CODES*/
  174. /**/
  175. /*_________________________________________________________________________________________________________*/
  176. enum {
  177.     cFrameColor                    = 0,
  178.     cBodyColor                    = 1,
  179.     cTextColor                    = 2,
  180.     cThumbColor                    = 3
  181. };
  182.  
  183. /*_________________________________________________________________________________________________________*/
  184. /**/
  185. /* • CONTROL TYPE DECLARATIONS*/
  186. /**/
  187. /*_________________________________________________________________________________________________________*/
  188. /**/
  189. /* Define ControlRef and ControlHandle*/
  190. /**/
  191. typedef struct ControlRecord ControlRecord, *ControlPtr, **ControlHandle;
  192.  
  193. typedef ControlHandle ControlRef;
  194.  
  195. /*_________________________________________________________________________________________________________*/
  196. /**/
  197. /* • CONTROL ACTIONPROC POINTER*/
  198. /**/
  199. /*_________________________________________________________________________________________________________*/
  200. typedef pascal void (*ControlActionProcPtr)(ControlRef theControl, ControlPartCode partCode);
  201.  
  202. #if GENERATINGCFM
  203. typedef UniversalProcPtr ControlActionUPP;
  204. #else
  205. typedef ControlActionProcPtr ControlActionUPP;
  206. #endif
  207.  
  208. /*_________________________________________________________________________________________________________*/
  209. /**/
  210. /* • CONTROL COLOR TABLE STRUCTURE*/
  211. /**/
  212. /*_________________________________________________________________________________________________________*/
  213. struct CtlCTab {
  214.     SInt32                            ccSeed;
  215.     SInt16                            ccRider;
  216.     SInt16                            ctSize;
  217.     ColorSpec                        ctTable[4];
  218. };
  219. typedef struct CtlCTab CtlCTab;
  220.  
  221. typedef CtlCTab *CCTabPtr, **CCTabHandle;
  222.  
  223. /*_________________________________________________________________________________________________________*/
  224. /**/
  225. /* • CONTROL RECORD STRUCTURE*/
  226. /**/
  227. /*_________________________________________________________________________________________________________*/
  228. struct ControlRecord {
  229.     ControlRef                        nextControl;
  230.     WindowRef                        contrlOwner;
  231.     Rect                            contrlRect;
  232.     UInt8                            contrlVis;
  233.     UInt8                            contrlHilite;
  234.     SInt16                            contrlValue;
  235.     SInt16                            contrlMin;
  236.     SInt16                            contrlMax;
  237.     Handle                            contrlDefProc;
  238.     Handle                            contrlData;
  239.     ControlActionUPP                contrlAction;
  240.     SInt32                            contrlRfCon;
  241.     Str255                            contrlTitle;
  242. };
  243. /*_________________________________________________________________________________________________________*/
  244. /**/
  245. /* • AUXILLARY CONTROL RECORD STRUCTURE*/
  246. /**/
  247. /*_________________________________________________________________________________________________________*/
  248. struct AuxCtlRec {
  249.     Handle                            acNext;
  250.     ControlRef                        acOwner;
  251.     CCTabHandle                        acCTable;
  252.     SInt16                            acFlags;
  253.     SInt32                            acReserved;
  254.     SInt32                            acRefCon;
  255. };
  256. typedef struct AuxCtlRec AuxCtlRec;
  257.  
  258. typedef AuxCtlRec *AuxCtlPtr, **AuxCtlHandle;
  259.  
  260. /*_________________________________________________________________________________________________________*/
  261. /**/
  262. /* • POP-UP MENU PRIVATE DATA STRUCTURE*/
  263. /**/
  264. /*_________________________________________________________________________________________________________*/
  265. struct PopupPrivateData {
  266.     MenuHandle                        mHandle;
  267.     SInt16                            mID;
  268. };
  269. typedef struct PopupPrivateData PopupPrivateData;
  270.  
  271. typedef PopupPrivateData *PopupPrivateDataPtr, **PopupPrivateDataHandle;
  272.  
  273.  
  274. #if GENERATINGCFM
  275. #else
  276. #endif
  277.  
  278. enum {
  279.     uppControlActionProcInfo = kPascalStackBased
  280.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(ControlRef)))
  281.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlPartCode)))
  282. };
  283.  
  284. #if GENERATINGCFM
  285. #define NewControlActionProc(userRoutine)        \
  286.         (ControlActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlActionProcInfo, GetCurrentArchitecture())
  287. #else
  288. #define NewControlActionProc(userRoutine)        \
  289.         ((ControlActionUPP) (userRoutine))
  290. #endif
  291.  
  292. #if GENERATINGCFM
  293. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  294.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlActionProcInfo, (theControl), (partCode))
  295. #else
  296. #define CallControlActionProc(userRoutine, theControl, partCode)        \
  297.         (*(userRoutine))((theControl), (partCode))
  298. #endif
  299.  
  300. /*_________________________________________________________________________________________________________*/
  301. /*    */
  302. /* • CONTROL CREATION / DELETION API'S*/
  303. /**/
  304. /*_________________________________________________________________________________________________________*/
  305. extern pascal ControlRef NewControl(WindowRef theWindow, const Rect *boundsRect, ConstStr255Param title, Boolean visible, SInt16 value, SInt16 min, SInt16 max, SInt16 procID, SInt32 refCon)
  306.  ONEWORDINLINE(0xA954);
  307. extern pascal ControlRef GetNewControl(SInt16 controlID, WindowRef owner)
  308.  ONEWORDINLINE(0xA9BE);
  309. extern pascal void DisposeControl(ControlRef theControl)
  310.  ONEWORDINLINE(0xA955);
  311. extern pascal void KillControls(WindowRef theWindow)
  312.  ONEWORDINLINE(0xA956);
  313. /*_________________________________________________________________________________________________________*/
  314. /*    */
  315. /* • CONTROL SHOWING/HIDING API'S*/
  316. /**/
  317. /*_________________________________________________________________________________________________________*/
  318. extern pascal void ShowControl(ControlRef theControl)
  319.  ONEWORDINLINE(0xA957);
  320. extern pascal void HideControl(ControlRef theControl)
  321.  ONEWORDINLINE(0xA958);
  322. /*_________________________________________________________________________________________________________*/
  323. /*    */
  324. /* • CONTROL DRAWING API'S*/
  325. /**/
  326. /*_________________________________________________________________________________________________________*/
  327. extern pascal void DrawControls(WindowRef theWindow)
  328.  ONEWORDINLINE(0xA969);
  329. extern pascal void Draw1Control(ControlRef theControl)
  330.  ONEWORDINLINE(0xA96D);
  331. #define DrawOneControl(theControl) Draw1Control(theControl)
  332. extern pascal void UpdateControls(WindowRef theWindow, RgnHandle updateRegion)
  333.  ONEWORDINLINE(0xA953);
  334. /*_________________________________________________________________________________________________________*/
  335. /*    */
  336. /* • CONTROL HIGHLIGHT API'S*/
  337. /**/
  338. /*_________________________________________________________________________________________________________*/
  339. extern pascal void HiliteControl(ControlRef theControl, ControlPartCode hiliteState)
  340.  ONEWORDINLINE(0xA95D);
  341. extern pascal ControlPartCode TrackControl(ControlRef theControl, Point thePoint, ControlActionUPP actionProc)
  342.  ONEWORDINLINE(0xA968);
  343. extern pascal void DragControl(ControlRef theControl, Point startPoint, const Rect *limitRect, const Rect *slopRect, DragConstraint axis)
  344.  ONEWORDINLINE(0xA967);
  345. extern pascal ControlPartCode TestControl(ControlRef theControl, Point thePoint)
  346.  ONEWORDINLINE(0xA966);
  347. extern pascal ControlPartCode FindControl(Point thePoint, WindowRef theWindow, ControlRef *theControl)
  348.  ONEWORDINLINE(0xA96C);
  349. /*_________________________________________________________________________________________________________*/
  350. /*    */
  351. /* • CONTROL MOVING/SIZING API'S*/
  352. /**/
  353. /*_________________________________________________________________________________________________________*/
  354. extern pascal void MoveControl(ControlRef theControl, SInt16 h, SInt16 v)
  355.  ONEWORDINLINE(0xA959);
  356. extern pascal void SizeControl(ControlRef theControl, SInt16 w, SInt16 h)
  357.  ONEWORDINLINE(0xA95C);
  358. /*_________________________________________________________________________________________________________*/
  359. /*    */
  360. /* • CONTROL TITLE API'S*/
  361. /**/
  362. /*_________________________________________________________________________________________________________*/
  363. extern pascal void SetControlTitle(ControlRef theControl, ConstStr255Param title)
  364.  ONEWORDINLINE(0xA95F);
  365. extern pascal void GetControlTitle(ControlRef theControl, Str255 title)
  366.  ONEWORDINLINE(0xA95E);
  367. /*_________________________________________________________________________________________________________*/
  368. /*    */
  369. /* • CONTROL VALUE, MIMIMUM, AND MAXIMUM API'S*/
  370. /**/
  371. /*_________________________________________________________________________________________________________*/
  372. extern pascal SInt16 GetControlValue(ControlRef theControl)
  373.  ONEWORDINLINE(0xA960);
  374. extern pascal void SetControlValue(ControlRef theControl, SInt16 newValue)
  375.  ONEWORDINLINE(0xA963);
  376. extern pascal SInt16 GetControlMinimum(ControlRef theControl)
  377.  ONEWORDINLINE(0xA961);
  378. extern pascal void SetControlMinimum(ControlRef theControl, SInt16 newMinimum)
  379.  ONEWORDINLINE(0xA964);
  380. extern pascal SInt16 GetControlMaximum(ControlRef theControl)
  381.  ONEWORDINLINE(0xA962);
  382. extern pascal void SetControlMaximum(ControlRef theControl, SInt16 newMaximum)
  383.  ONEWORDINLINE(0xA965);
  384. /*_________________________________________________________________________________________________________*/
  385. /*    */
  386. /* • CONTROL VARIANT AND WINDOW INFORMATION API'S*/
  387. /**/
  388. /*_________________________________________________________________________________________________________*/
  389. extern pascal SInt16 GetControlVariant(ControlRef theControl)
  390.  ONEWORDINLINE(0xA809);
  391. /*_________________________________________________________________________________________________________*/
  392. /*    */
  393. /* • CONTROL ACTION PROC API'S*/
  394. /**/
  395. /*_________________________________________________________________________________________________________*/
  396. extern pascal void SetControlAction(ControlRef theControl, ControlActionUPP actionProc)
  397.  ONEWORDINLINE(0xA96B);
  398. extern pascal ControlActionUPP GetControlAction(ControlRef theControl)
  399.  ONEWORDINLINE(0xA96A);
  400. /*_________________________________________________________________________________________________________*/
  401. /*    */
  402. /* • CONTROL ACCESSOR API'S*/
  403. /**/
  404. /*_________________________________________________________________________________________________________*/
  405. extern pascal void SetControlReference(ControlRef theControl, SInt32 data)
  406.  ONEWORDINLINE(0xA95B);
  407. extern pascal SInt32 GetControlReference(ControlRef theControl)
  408.  ONEWORDINLINE(0xA95A);
  409. /*
  410. *****************************************************************************
  411. *                                                                           *
  412. * The conditional STRICT_CONTROLS has been removed from this interface file.*
  413. * The accessor macros to a ControlRecord are no longer necessary.           *
  414. *                                                                           *
  415. *****************************************************************************
  416.  
  417. Details:
  418. The original purpose of the STRICT_ conditionals and accessor macros was to
  419. help ease the transition to Copland.   Shared data structures are difficult
  420. to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  421. WindowRecord and other data structures, we would begin the migration to 
  422. system data structures being completely hidden from applications. 
  423.  
  424. After many design reviews, it was finally concluded that with this sort of
  425. migration, the system could never tell when an application was no longer 
  426. peeking at a WindowRecord, and thus the data structure might never become 
  427. system owned.  Additionally, there were many other limitations in the classic
  428. toolbox that were begging to be addressed.
  429.  
  430. The final decision was to leave the traditional toolbox as a compatibility mode.
  431. The preferred toolbox API for Copland is a new SOM(tm) based architecture 
  432. (e.g. HIWindows.idl).  Windows, menu, controls, etc are each a SOM object 
  433. with methods for drawing, event handling, and customization.
  434.  
  435. */
  436. #define GetControlListFromWindow(theWindowRef)        ( *(ControlRef *) (((UInt8 *) theWindowRef) + sizeof(GrafPort) + 0x20))
  437.  
  438. extern pascal Boolean GetAuxiliaryControlRecord(ControlRef theControl, AuxCtlHandle *acHndl)
  439.  ONEWORDINLINE(0xAA44);
  440.  
  441. extern pascal void SetControlColor(ControlRef theControl, CCTabHandle newColorTable)
  442.  ONEWORDINLINE(0xAA43);
  443. /*_________________________________________________________________________________________________________*/
  444. /*    */
  445. /* • VALID 'CDEF' MESSAGES*/
  446. /**/
  447. /*_________________________________________________________________________________________________________*/
  448. typedef SInt16 ControlDefProcMessage;
  449.  
  450.  
  451. enum {
  452.     drawCntl                    = 0,
  453.     testCntl                    = 1,
  454.     calcCRgns                    = 2,
  455.     initCntl                    = 3,
  456.     dispCntl                    = 4,
  457.     posCntl                        = 5,
  458.     thumbCntl                    = 6,
  459.     dragCntl                    = 7,
  460.     autoTrack                    = 8,
  461.     calcCntlRgn                    = 10,
  462.     calcThumbRgn                = 11,
  463.     drawThumbOutline            = 12
  464. };
  465.  
  466. /*_________________________________________________________________________________________________________*/
  467. /*    */
  468. /* • MAIN ENTRY POINT FOR 'CDEF'*/
  469. /**/
  470. /*_________________________________________________________________________________________________________*/
  471. typedef pascal SInt32 (*ControlDefProcPtr)(SInt16 varCode, ControlRef theControl, ControlDefProcMessage message, SInt32 param);
  472.  
  473. #if GENERATINGCFM
  474. typedef UniversalProcPtr ControlDefUPP;
  475. #else
  476. typedef ControlDefProcPtr ControlDefUPP;
  477. #endif
  478.  
  479. enum {
  480.     uppControlDefProcInfo = kPascalStackBased
  481.          | RESULT_SIZE(SIZE_CODE(sizeof(SInt32)))
  482.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(SInt16)))
  483.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ControlRef)))
  484.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(ControlDefProcMessage)))
  485.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(SInt32)))
  486. };
  487.  
  488. #if GENERATINGCFM
  489. #define NewControlDefProc(userRoutine)        \
  490.         (ControlDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlDefProcInfo, GetCurrentArchitecture())
  491. #else
  492. #define NewControlDefProc(userRoutine)        \
  493.         ((ControlDefUPP) (userRoutine))
  494. #endif
  495.  
  496. #if GENERATINGCFM
  497. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  498.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppControlDefProcInfo, (varCode), (theControl), (message), (param))
  499. #else
  500. #define CallControlDefProc(userRoutine, varCode, theControl, message, param)        \
  501.         (*(userRoutine))((varCode), (theControl), (message), (param))
  502. #endif
  503.  
  504. /*_________________________________________________________________________________________________________*/
  505. /*    */
  506. /* • CONSTANTS FOR DRAWCNTL MESSAGE PASSED IN PARAM*/
  507. /**/
  508. /*_________________________________________________________________________________________________________*/
  509. enum {
  510.     kDrawControlEntireControl    = 0,
  511.     kDrawControlIndicatorOnly    = 129
  512. };
  513.  
  514. /*_________________________________________________________________________________________________________*/
  515. /*    */
  516. /* • CONSTANTS FOR DRAGCNTL MESSAGE PASSED IN PARAM*/
  517. /**/
  518. /*_________________________________________________________________________________________________________*/
  519. enum {
  520.     kDragControlEntireControl    = 0,
  521.     kDragControlIndicator        = 1
  522. };
  523.  
  524. /*_________________________________________________________________________________________________________*/
  525. /*    */
  526. /* • DRAG CONSTRAINT STRUCTURE PASSED IN PARAM FOR THUMBCNTL MESSAGE (IM I-332)*/
  527. /**/
  528. /*_________________________________________________________________________________________________________*/
  529. struct IndicatorDragConstraint {
  530.     Rect                            limitRect;
  531.     Rect                            slopRect;
  532.     DragConstraint                    axis;
  533. };
  534. typedef struct IndicatorDragConstraint IndicatorDragConstraint;
  535.  
  536. typedef IndicatorDragConstraint *IndicatorDragConstraintPtr, **IndicatorDragConstraintHandle;
  537.  
  538. /*_________________________________________________________________________________________________________*/
  539. /**/
  540. /* • OLD ROUTINE NAMES*/
  541. /**/
  542. /*   These are provided for compatiblity with older source bases.  It is recommended to not use them since*/
  543. /*     they may removed from this interface file at any time.*/
  544. /**/
  545. /*_________________________________________________________________________________________________________*/
  546. #if OLDROUTINENAMES
  547.  
  548. enum {
  549.     useWFont                    = 8
  550. };
  551.  
  552. enum {
  553.     inLabel                        = 1,
  554.     inMenu                        = 2,
  555.     inTriangle                    = 4,
  556.     inButton                    = 10,
  557.     inCheckBox                    = 11,
  558.     inUpButton                    = 20,
  559.     inDownButton                = 21,
  560.     inPageUp                    = 22,
  561.     inPageDown                    = 23,
  562.     inThumb                        = 129
  563. };
  564.  
  565. enum {
  566.     kNoHiliteControlPart        = 0,
  567.     kInLabelControlPart            = 1,
  568.     kInMenuControlPart            = 2,
  569.     kInTriangleControlPart        = 4,
  570.     kInButtonControlPart        = 10,
  571.     kInCheckBoxControlPart        = 11,
  572.     kInUpButtonControlPart        = 20,
  573.     kInDownButtonControlPart    = 21,
  574.     kInPageUpControlPart        = 22,
  575.     kInPageDownControlPart        = 23,
  576.     kInIndicatorControlPart        = 129,
  577.     kReservedControlPart        = 254,
  578.     kControlInactiveControlPart    = 255
  579. };
  580.  
  581. #endif
  582. #if CGLUESUPPORTED
  583. extern void dragcontrol(ControlRef theControl, Point *startPt, const Rect *limitRect, const Rect *slopRect, short axis);
  584. extern ControlRef newcontrol(WindowRef theWindow, const Rect *boundsRect, const char *title, Boolean visible, short value, short min, short max, short procID, long refCon);
  585. extern short findcontrol(Point *thePoint, WindowRef theWindow, ControlRef *theControl);
  586. extern void getcontroltitle(ControlRef theControl, char *title);
  587. extern void setcontroltitle(ControlRef theControl, const char *title);
  588. extern short trackcontrol(ControlRef theControl, Point *thePoint, ControlActionUPP actionProc);
  589. extern short testcontrol(ControlRef theControl, Point *thePt);
  590. #endif
  591. #if OLDROUTINENAMES
  592. #define GetControlOwningWindowControlList(theWindowRef)        ( *(ControlRef *) (((UInt8 *) theWindowRef) + sizeof(GrafPort) + 0x20))
  593. #define SetCTitle(theControl, title) SetControlTitle(theControl, title)
  594. #define GetCTitle(theControl, title) GetControlTitle(theControl, title)
  595. #define UpdtControl(theWindow, updateRgn) UpdateControls(theWindow, updateRgn)
  596. #define SetCtlValue(theControl, theValue) SetControlValue(theControl, theValue)
  597. #define GetCtlValue(theControl) GetControlValue(theControl)
  598. #define SetCtlMin(theControl, minValue) SetControlMinimum(theControl, minValue)
  599. #define GetCtlMin(theControl) GetControlMinimum(theControl)
  600. #define SetCtlMax(theControl, maxValue) SetControlMaximum(theControl, maxValue)
  601. #define GetCtlMax(theControl) GetControlMaximum(theControl)
  602. #define GetAuxCtl(theControl, acHndl) GetAuxiliaryControlRecord(theControl, acHndl)
  603. #define SetCRefCon(theControl, data) SetControlReference(theControl, data)
  604. #define GetCRefCon(theControl) GetControlReference(theControl)
  605. #define SetCtlAction(theControl, actionProc) SetControlAction(theControl, actionProc)
  606. #define GetCtlAction(theControl) GetControlAction(theControl)
  607. #define SetCtlColor(theControl, newColorTable) SetControlColor(theControl, newColorTable)
  608. #define GetCVariant(theControl) GetControlVariant(theControl)
  609. #if CGLUESUPPORTED
  610. #define getctitle(theControl, title) getcontroltitle(theControl, title)
  611. #define setctitle(theControl, title) setcontroltitle(theControl, title)
  612. #endif
  613. #endif
  614.  
  615. /*
  616. *****************************************************************************
  617. *                                                                           *
  618. * The conditional STRICT_CONTROLS has been removed from this interface file.*
  619. * The accessor macros to a ControlRecord are no longer necessary.           *
  620. *                                                                           *
  621. *****************************************************************************
  622.  
  623. Details:
  624. The original purpose of the STRICT_ conditionals and accessor macros was to
  625. help ease the transition to Copland.   Shared data structures are difficult
  626. to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  627. WindowRecord and other data structures, we would begin the migration to 
  628. system data structures being completely hidden from applications. 
  629.  
  630. After many design reviews, it was finally concluded that with this sort of
  631. migration, the system could never tell when an application was no longer 
  632. peeking at a WindowRecord, and thus the data structure might never become 
  633. system owned.  Additionally, there were many other limitations in the classic
  634. toolbox that were begging to be addressed.
  635.  
  636. The final decision was to leave the traditional toolbox as a compatibility mode.
  637. The preferred toolbox API for Copland is a new SOM(tm) based architecture 
  638. (e.g. HIWindows.idl).  Windows, menu, controls, etc are each a SOM object 
  639. with methods for drawing, event handling, and customization.
  640.  
  641. */
  642.  
  643. #if PRAGMA_IMPORT_SUPPORTED
  644. #pragma import off
  645. #endif
  646.  
  647. #if PRAGMA_ALIGN_SUPPORTED
  648. #pragma options align=reset
  649. #endif
  650.  
  651. #ifdef __cplusplus
  652. }
  653. #endif
  654.  
  655. #endif /* __CONTROLS__ */
  656.